import request from '../utils/request'

// 文章列表
export const queryPageApi = function getArticleList(params) {
  return request({
    url: '/article',
    method: 'get',
    params
  })
}

// 文章新增
export const addApi = function addArticle(data) {
  return request({
    url: '/article',
    method: 'post',
    data
  })
}

// 文章详情
export const getArticleById = function(id) {
  return request({
    url: `/article/${id}`,
    method: 'get'
  })
}

// 文章更新
export const updateApi = function updateArticle(data) {
  return request({
    url: '/article',
    method: 'put',
    data
  })
}

// 文章删除
export const deleteApi = function deleteArticle(id) {
  return request({
    url: `/article/${id}`,
    method: 'delete'
  })
}
